Optimal. Leaf size=90 \[ -\frac{2 a^2 \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2+b^2}}\right )}{d \left (a^2+b^2\right )^{3/2}}-\frac{a \tanh (c+d x)}{d \left (a^2+b^2\right )}-\frac{b \text{sech}(c+d x)}{d \left (a^2+b^2\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.105545, antiderivative size = 90, normalized size of antiderivative = 1., number of steps used = 8, number of rules used = 7, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {2727, 3767, 8, 2606, 2660, 618, 204} \[ -\frac{2 a^2 \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2+b^2}}\right )}{d \left (a^2+b^2\right )^{3/2}}-\frac{a \tanh (c+d x)}{d \left (a^2+b^2\right )}-\frac{b \text{sech}(c+d x)}{d \left (a^2+b^2\right )} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2727
Rule 3767
Rule 8
Rule 2606
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\tanh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx &=-\frac{a \int \text{sech}^2(c+d x) \, dx}{a^2+b^2}+\frac{a^2 \int \frac{1}{a+b \sinh (c+d x)} \, dx}{a^2+b^2}+\frac{b \int \text{sech}(c+d x) \tanh (c+d x) \, dx}{a^2+b^2}\\ &=-\frac{(i a) \operatorname{Subst}(\int 1 \, dx,x,-i \tanh (c+d x))}{\left (a^2+b^2\right ) d}-\frac{\left (2 i a^2\right ) \operatorname{Subst}\left (\int \frac{1}{a-2 i b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (i c+i d x)\right )\right )}{\left (a^2+b^2\right ) d}-\frac{b \operatorname{Subst}(\int 1 \, dx,x,\text{sech}(c+d x))}{\left (a^2+b^2\right ) d}\\ &=-\frac{b \text{sech}(c+d x)}{\left (a^2+b^2\right ) d}-\frac{a \tanh (c+d x)}{\left (a^2+b^2\right ) d}+\frac{\left (4 i a^2\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2+b^2\right )-x^2} \, dx,x,-2 i b+2 a \tan \left (\frac{1}{2} (i c+i d x)\right )\right )}{\left (a^2+b^2\right ) d}\\ &=-\frac{2 a^2 \tanh ^{-1}\left (\frac{b-a \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2+b^2}}\right )}{\left (a^2+b^2\right )^{3/2} d}-\frac{b \text{sech}(c+d x)}{\left (a^2+b^2\right ) d}-\frac{a \tanh (c+d x)}{\left (a^2+b^2\right ) d}\\ \end{align*}
Mathematica [A] time = 0.195656, size = 106, normalized size = 1.18 \[ -\frac{a \left (2 a \tan ^{-1}\left (\frac{b-a \tanh \left (\frac{1}{2} (c+d x)\right )}{\sqrt{-a^2-b^2}}\right )-\sqrt{-a^2-b^2} \tanh (c+d x)\right )-b \sqrt{-a^2-b^2} \text{sech}(c+d x)}{d \left (-a^2-b^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.001, size = 103, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ( 8\,{\frac{{a}^{2}}{ \left ( 4\,{a}^{2}+4\,{b}^{2} \right ) \sqrt{{a}^{2}+{b}^{2}}}{\it Artanh} \left ( 1/2\,{\frac{2\,a\tanh \left ( 1/2\,dx+c/2 \right ) -2\,b}{\sqrt{{a}^{2}+{b}^{2}}}} \right ) }+2\,{\frac{-a\tanh \left ( 1/2\,dx+c/2 \right ) -b}{ \left ({a}^{2}+{b}^{2} \right ) \left ( \left ( \tanh \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}+1 \right ) }} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.12362, size = 883, normalized size = 9.81 \begin{align*} \frac{2 \, a^{3} + 2 \, a b^{2} +{\left (a^{2} \cosh \left (d x + c\right )^{2} + 2 \, a^{2} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a^{2} \sinh \left (d x + c\right )^{2} + a^{2}\right )} \sqrt{a^{2} + b^{2}} \log \left (\frac{b^{2} \cosh \left (d x + c\right )^{2} + b^{2} \sinh \left (d x + c\right )^{2} + 2 \, a b \cosh \left (d x + c\right ) + 2 \, a^{2} + b^{2} + 2 \,{\left (b^{2} \cosh \left (d x + c\right ) + a b\right )} \sinh \left (d x + c\right ) - 2 \, \sqrt{a^{2} + b^{2}}{\left (b \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right ) + a\right )}}{b \cosh \left (d x + c\right )^{2} + b \sinh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) + 2 \,{\left (b \cosh \left (d x + c\right ) + a\right )} \sinh \left (d x + c\right ) - b}\right ) - 2 \,{\left (a^{2} b + b^{3}\right )} \cosh \left (d x + c\right ) - 2 \,{\left (a^{2} b + b^{3}\right )} \sinh \left (d x + c\right )}{{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d \cosh \left (d x + c\right )^{2} + 2 \,{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) +{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d \sinh \left (d x + c\right )^{2} +{\left (a^{4} + 2 \, a^{2} b^{2} + b^{4}\right )} d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\tanh ^{2}{\left (c + d x \right )}}{a + b \sinh{\left (c + d x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.37836, size = 163, normalized size = 1.81 \begin{align*} -\frac{\frac{a^{2} \log \left (\frac{{\left | -2 \, b e^{\left (d x + 2 \, c\right )} - 2 \, a e^{c} - 2 \, \sqrt{a^{2} + b^{2}} e^{c} \right |}}{{\left | -2 \, b e^{\left (d x + 2 \, c\right )} - 2 \, a e^{c} + 2 \, \sqrt{a^{2} + b^{2}} e^{c} \right |}}\right )}{{\left (a^{2} + b^{2}\right )}^{\frac{3}{2}}} + \frac{2 \,{\left (b e^{\left (d x + c\right )} - a\right )}}{{\left (a^{2} + b^{2}\right )}{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]